package com.orange.delivery.dao;

import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;

import com.orange.delivery.model.persistent.Market;
import com.orange.delivery.technicalservice.tool.MultiValuedMap;

/**
 * Interface for adding custom behavior to the market repository
 * 
 * @author biaf7492
 * 
 */
public interface MarketRepositoryCustom {

	/**
	 * find market with same exact name
	 * 
	 * @param nom
	 *            market name
	 * @return true if market exists, false otherwise
	 */
	public boolean existsMarketWithName(String nom);

	/**
	 * Get a page of markets using paging and sorting information and matching a set of criterias
	 * 
	 * @param pageInfo
	 *            information regarding paging and sorting
	 * @param criteria
	 *            criterias for filtering the set of retrieved markets
	 * @return the requested page of market entities
	 */
	public Page<Market> findByCriteria(Pageable pageInfo, MultiValuedMap<String, String> criteria);

}
